package com.vpx.server.mapper.system;

import com.vpx.server.framework.base.BaseMapper;
import com.vpx.server.bean.entity.SysRoleAuth;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author liuks
 * @title: vpx
 * @module 角色权限
 * @description: 角色权限Mapper
 * @date 2021/9/9
 */
public interface SysRoleAuthMapper extends BaseMapper<SysRoleAuth> {

    /**
     * 根据角色id查询角色菜单操作权限
     * @param roleId
     * @return
     */
    @Select("select * from sys_role_auth where role_id = #{roleId}")
    List<SysRoleAuth> querySysRoleAuthByRoleId(@Param("roleId") Long roleId);

    /**
     * 根据角色id删除角色权限
     * @param roleId
     * @return
     */
    @Delete("delete from sys_role_auth where role_id = #{roleId}")
    int deleteSysRoleAuthByRoleId(@Param("roleId") Long roleId);
}
